'use client'

import { useState } from 'react'
import { PlusIcon } from '@heroicons/react/24/outline'
import { CreateCategoryDialog } from './create-category-dialog'

export function CategoryHeader() {
  const [isCreateOpen, setIsCreateOpen] = useState(false)

  return (
    <div className="flex justify-between items-center">
      <h1 className="text-2xl font-semibold text-gray-900">分类管理</h1>
      <button
        onClick={() => setIsCreateOpen(true)}
        className="bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 flex items-center"
      >
        <PlusIcon className="h-5 w-5 mr-2" />
        添加分类
      </button>
      <CreateCategoryDialog open={isCreateOpen} onClose={() => setIsCreateOpen(false)} />
    </div>
  )
} 